#!/bin/bash
#-----------HEADER------------------------------------------------------------|
#AUTOR:
# Jefferson Rocha <lrcjefferson@gmail.com>
#
#PROGRAM:
# Desc-generator - Create a template (slack-desc)
#
#PERMISSIONS:
# U have all permissions, only especified credits for autor.
#-----------------------------------------------------------------------------|

case $1 in
  -g|generate)
      read -p "App name: " app
      [ -z "$app" ] && echo -e "\033[31;1mNULL! insert APP NAME.\033[m" && exit 1
      app=${app,,}    # Convert UPPER for LOWER
      cat << EOF > slack-desc
|-----handy-ruler------------------------------------------------------|
${app}: ${app} (Short description of the application)
${app}:      <this line is generally left blank>
${app}: Description of application, dont utrapass handy-huler '|'
${app}: 
${app}:
${app}: 
${app}: 
${app}: 
${app}:
${app}: Homepage:
${app}:
EOF
  ;;

 *) cat << EOF
----------------------------------------------------------------
Use option -g our generate for create a template slack-desc.
----------------------------------------------------------------
EXAMPLE:
$ desc-generator generate
App name: leafpad

$ cat slack-desc
|-----handy-ruler------------------------------------------------------|
leafpad: leafpad (Short description of the application)
leafpad:      <this line is generally left blank>
leafpad: Description of application, don't utrapass handy-huler '|'
leafpad: 
leafpad:
leafpad: 
leafpad: 
leafpad: 
leafpad:
leafpad: Homepage:
leafpad:

----------------------------------------------------------------
IMPORTANT!
Move desc-generator for /usr/bin.
Run desc-generator in folder "install".
----------------------------------------------------------------
EOF
  ;;
esac

